# -*-coding:utf-8 -*-
# @Time: 2023/2/22 0022 上午 11:47
# @Author: Cwoner
# @Organization: CTIM
# @Software: PyCharm

from DaQingRBao import DaQingRBao
from DaQingWanBao import DaQingWanBao
from HaErBinRBao import HaErBinRBao
from HeiLongJiangLaoNianBao import HeiLongJiangLaoNianBao
from HeiLongjiangRbao import HeiLongjiangRbao
from HeiLongJiangShengHuoBao import HeiLongJiangShengHuoBao
from MuDanJiangRBao import MuDanJiangRBao
from QiTaiHeRBao import QiTaiHeRBao
from DaLianRBao import DaLianRBao
from DaLianWanBao import DaLianWanBao
from ShenYangRBao import ShenYangRBao
from ShenYangWanBao import ShenYangWanBao
from SuiHuaRBao import SuiHuaRBao
from TongLingRBao import TongLingRBao
from LiaoNingRBao import LiaoNingRBao
from LiaoShenWanBao import LiaoShenWanBao
from BanDaoChenBao import BanDaoChenBao
from YingKouRBao import YingKouRBao
from TieLingRBao import TieLingRBao
from ChaoYangRBao import ChaoYangRBao
from FuXinRBao import FuXinRBao
from BenGangRBao import BenGangRBao
from YanDuRBao import YanDuRBao
from XinWanBao import XinWanBao
from HeiHeRBao import HeiHeRBao
from HeFeiRBao import HeFeiRBao
from HeFeiWanBao import HeFeiWBao
from JiangHuiChenBao import JiangHuiChenBao
from HuaiHeZaoBao import HuaiHeZaoBao
from HuaiNanRBao import HuaiNanRBao
from WanXiRBao import WanXiRBao
from TongLingYouSeJinShu import TongLingYouSeJinShu
from DaJiangWanBao import DaJiangWanBao
from WuHuRBao import WuHuRBao
from FoXiaoBao import FoXiaoBao
from XuanChengRBao import XuanChengRBao
from AnHuiFaZhiBao import AnHuiFaZhiBao
from AnHuiGongRenRBao import AnHuiGongRenRBao
from YingZhouWanBao import YingZhouWanBao
from AnHuiQingNianBao import AnHuiQingNianBao
from AnHuiRBao import AnHuiRBao
from AnHuiRBaoNongCunBao import AnHuiRBaoNongCunBao
from AnHuiShangBao import AnHuiShangBao
from GongShangDaoBao import GongShangDaoBao
from JiangHuaiShiBao import JiangHuaiShiBao
from ShiChangXingBao import ShiChangXingBao
from FuYangRBao import FuYangRBao
from XinAnWanBao import XinAnWanBao
from AnQingRBao import AnQingRBao
from AnQingWanBao import AnQingWanBao
from HuangShanRBao import HuangShanRBao
from BoZhouWanBao import BoZhouWanBao
from ChiZhouRBao import ChiZhouRBao
from ChuZhouRBao import ChuZhouRBao
from GuangZhouRBao import GuangZhouRBao
from YiCunRBao import YiCunRBao
from JiXiRBao import JiXiRBao
from ShuangYaShanRBao import ShuangYaShanRBao
from ZhongShanRBao import ZhongShanRBao
from DongNanRBao import DongNanRBao
from ShiDaiZhouBao import ShiDaiZhouBao
from WuLuMuQiWanBao import WuLuMuQiWanBao
from HuHeHaoTeWanBao import HuHeHaoTeWanBao #pdf单页
from NeiMengGuFaZhiBao import NeiMengGuFaZhiBao #昨日 pdf群
from XinJiangFaZhiBao import XinJiangFaZhiBao #图-详情页
from GongRenShiBao import GongRenShiBao
from XinJiangRBao import XinJiangRBao
from TianJinRBao import TianJinRBao
from MeiRXinBao import MeiRXinBao
from TianJinGongRenBao import TianJinGongRenBao
from XiJiangRBao import XiJiangRBao
from MaoMingWanBao import MaoMingWanBao
from MaoMingRBao import MaoMingRBao
from KanJiangWanBao import KanJiangWanBao
from KanJiangRBao import KanJiangRBao
from YangJiangRBao import YangJiangRBao
from JiangMenRBao import JiangMenRBao
from ShanWeiRBao import ShanWeiRBao
from HeYuanWanBao import HeYuanWanBao
from ShaoGuanXinWen import ShaoGuanXinWen
from ZhuJiangShangBao import ZhuJiangShangBao
from ZhuJiangShiBao import ZhuJiangShiBao
from FoShanRBao import FoShanRBao
from TeQuQingNianBao_ZhouBao import TeQuQingNianBao_ZhouBao
from ZhuJiangWanBao import ZhuJiangWanBao
from ZhuHaiTeQuBao import ZhuHaiTeQuBao
from ShenZhenTeQuBao import ShenZhenTeQuBao
from ShenZhenShangBao import ShenZhenShangBao
from NanFangJiaoYuShiBao import NanFangJiaoYuShiBao
from ZhengJuanShiBao import ZhengJuanShiBao
from XinXiShiBao import XinXiShiBao
from YangChengWanBao import YangChengWanBao
from XinKuaiBao import XinKuaiBao
from NanFangRBao import NanFangRBao
from NanFangNongCunBao import NanFangNongCunBao
from NanFangDuShiBao import NanFangDuShiBao
from GuangDongKeJiBao import GuangDongKeJiBao
from BengBuRBao import BengBuRBao
from XiaMenRiBao import XiaMenRiBao
from ShanTouRBao import ShanTouRBao
from MeiZhouRBao import MeiZhouRBao
from HuiZhouRBao import HuiZhouRBao
from ShiShiRiBao import ShiShiRiBao
from HaiXiChenBao import HaiXiChenBao
from MeiZhouRiBao import MeiZhouRiBao
from MinDongRiBao import MinDongRiBao
from MinNanRiBao import MinNanRiBao
from SanMingRiBao import SanMingRiBao
from BeiHaiRiBao import BeiHaiRiBao
from GuiGangRiBao import GuiGangRiBao
from CangZhouRBao import CangZhouRBao #昨日
from CangZhouWanBao import CangZhouWanBao #昨日
from LangFangRBao import LangFangRBao #昨日
from DaXingAnLingRBao import DaXingAnLingRBao
from ZuoJiangRBao import ZuoJiangRBao
from ShiJiJingJIBaoDao21 import ShiJiJingJIBaoDao21
from GuangDongJianSheBao import GuangDongJianSheBao
from XiJiangRBao import XiJiangRBao
from QingYuanRBao import QingYuanRBao
from ChaoZhouRBao import ChaoZhouRBao
from YunFuRBao import YunFuRBao
from JieYangRBao import JieYangRBao
from LanZhouChenBao import LanZhouChenBao
from NieDuBao import NieDuBao
from TianShuiRBao import TianShuiRBao
from TianShuiWanBao import TianShuiWanBao
from LinXiaMinZhuRBao import LinXiaMinZhuRBao
from JiaYuGuanRBao import JiaYuGuanRBao
from LongDongRBao import LongDongRBa
from LongNanRBao import LongNanRBao
from HanDanRBao import HanDanRBao
from HanDanWanBao import HanDanWanBao
from BaoDingRBao import BaoDingRBao
from BaoDingWanBao import BaoDingWanBao
from ZhangJiaKouRBao import ZhangJiaKouRBao
from TangShanLaoDongZheRBao import TangShanLaoDongZheRBao
from LangFangDuShiBap import LangFangDuShiBap
from XingTaiRBao import XingTaiRBao
from NiuChengWanBao import NiuChengWanBao
from DingZhouRBao import DingZhouRBao
from YanZhaoWanBao import YanZhaoWanBao
from YanZhaoLaoNianBao import YanZhaoLaoNianBao

import time
import datetime

#'20230301','20230302','20230303','20230304','20230305','20230306','20230307','20230308','20230309','20230310','20230311','20230312','20230313',
ccdate = ['20230301','20230302','20230303','20230304','20230305','20230307','20230306','20230308','20230309','20230310',
          '20230311','20230312','20230313','20230314','20230315','20230316','202303017','20230318','20230319','20230320',
          '20230321','20230322','20230323','20230324','20230325','20230326','20230327']
cdate = ['20230415','20230416','20230417']


def cc_dispacther(ccItem):
    '''原本用于抽测日期调度，现改为日采集'''
    try:
        dq = DaQingRBao(ccItem)
        dq.run()
    except:
        pass
    try:
        dqwb = DaQingWanBao(ccItem)
        dqwb.run()
    except:
        pass
    try:
        hrbrb = HaErBinRBao(ccItem)
        hrbrb.run()
    except:
        pass
    try:
        hljlnb = HeiLongJiangLaoNianBao(ccItem)
        hljlnb.run()
    except:
        pass
    try:
        hljrb = HeiLongjiangRbao(ccItem)
        hljrb.run()
    except:
        pass
    try:
        hljshb = HeiLongJiangShengHuoBao(ccItem)
        hljshb.run()
    except:
        pass
    try:
        mdjrb = MuDanJiangRBao(ccItem)
        mdjrb.run()
    except:
        pass
    try:
        qthrb = QiTaiHeRBao(ccItem)
        qthrb.run()
    except:
        pass
    try:
        xwb = XinWanBao(ccItem)
        xwb.run()
    except:
        pass
    try:
        ShiDaiZhouBao(ccItem).run()#该媒体原本是每周3、4运行。现改为每天运行，通过监测pdf的url的日期来判断是否下载数据。
    except:
        pass
    try:
        WuLuMuQiWanBao(ccItem).run()
    except:
        pass
    try:
        HuHeHaoTeWanBao(ccItem).run()
    except:
        pass
    try:
        HuHeHaoTeWanBao(ccItem).run()
    except:
        pass
    try:
        XiJiangRBao(ccItem).run()
    except:
        pass
    try:
        MaoMingWanBao(ccItem).run()
    except:
        pass
    try:
        MaoMingRBao(ccItem).run()
    except:
        pass
    try:
        KanJiangWanBao(ccItem).run()
    except:
        pass
    try:
        KanJiangRBao(ccItem).run()
    except:
        pass
    try:
        YangJiangRBao(ccItem).run()
    except:
        pass
    try:
        JiangMenRBao(ccItem).run()
    except:
        pass
    try:
        ShanWeiRBao(ccItem).run()
    except:
        pass
    try:
        HuiZhouRBao(ccItem).run()
    except:
        pass
    try:
        MeiZhouRBao(ccItem).run()
    except:
        pass
    try:
        HeYuanWanBao(ccItem).run()
    except:
        pass
    try:
        ShaoGuanXinWen(ccItem).run()
    except:
        pass
    try:
        ZhuJiangShangBao(ccItem).run()
    except:
        pass
    try:
        ZhuJiangShiBao(ccItem).run()
    except:
        pass
    try:
        FoShanRBao(ccItem).run()
    except:
        pass
    try:
        TeQuQingNianBao_ZhouBao(ccItem).run()
    except:
        pass
    try:
        ShanTouRBao(ccItem).run()
    except:
        pass
    try:
        ZhuJiangWanBao(ccItem).run()
    except:
        pass
    try:
        ZhuHaiTeQuBao(ccItem).run()
    except:
        pass
    try:
        ShenZhenTeQuBao(ccItem).run()
    except:
        pass
    try:
        ShenZhenShangBao(ccItem).run()
    except:
        pass
    try:
        NanFangJiaoYuShiBao(ccItem).run()
    except:
        pass
    try:
        ZhengJuanShiBao(ccItem).run()
    except:
        pass
    try:
        XinXiShiBao(ccItem).run()
    except:
        pass
    try:
        YangChengWanBao(ccItem).run()
    except:
        pass
    try:
        XinKuaiBao(ccItem).run()
    except:
        pass
    try:
        NanFangRBao(ccItem).run()
    except:
        pass
    try:
        NanFangNongCunBao(ccItem).run()
    except:
        pass
    try:
        NanFangDuShiBao(ccItem).run()
    except:
        pass
    try:
        GuangDongKeJiBao(ccItem).run()
    except:
        pass
    try:
        GuangDongJianSheBao(ccItem).run()
    except:
        pass
    try:
        ShiJiJingJIBaoDao21(ccItem).run()
    except:
        pass
    try:
        ZuoJiangRBao(ccItem).run()
    except:
        pass
    try:
        DaXingAnLingRBao(ccItem).run()
    except:
        pass
    try:
        BengBuRBao(ccItem).run()
    except:
        pass
    try:
        XiaMenRiBao(ccItem).run()
    except:
        pass
    try:
        ShiShiRiBao(ccItem).run()
    except:
        pass
    try:
        HaiXiChenBao(ccItem).run()
    except:
        pass
    try:
        MeiZhouRiBao(ccItem).run()
    except:
        pass
    try:
        MinDongRiBao(ccItem).run()
    except:
        pass
    try:
        MinNanRiBao(ccItem).run()
    except:
        pass
    try:
        BeiHaiRiBao(ccItem).run()
    except:
        pass
    try:
        GuiGangRiBao(ccItem).run()
    except:
        pass
    try:
        SanMingRiBao(ccItem).run()
    except:
        pass
    try:
        DaXingAnLingRBao(ccItem).run()
    except:
        pass
    try:
        ZuoJiangRBao(ccItem).run()
    except:
        pass
    try:
        ShiJiJingJIBaoDao21(ccItem).run()
    except:
        pass
    try:
        QingYuanRBao(ccItem).run()
    except:
        pass
    try:
        ChaoZhouRBao(ccItem).run()
    except:
        pass
    try:
        YunFuRBao(ccdate).run()
    except:
        pass
    try:
        JieYangRBao(ccdate).run()
    except:
        pass
    try:
        LanZhouChenBao(ccdate).run()
    except:
        pass
    try:
        NieDuBao(ccdate).run()
    except:
        pass
    try:
        TianShuiRBao(ccdate).run()
    except:
        pass
    try:
        TianShuiWanBao(ccdate).run()
    except:
        pass
    try:
        LinXiaMinZhuRBao(ccdate).run()
    except:
        pass
    try:
        JiaYuGuanRBao(ccdate).run()
    except:
        pass
    try:
        LongDongRBa(ccItem).run()
    except:
        pass
    try:
        LongNanRBao(ccItem).run()
    except:
        pass
    try:
        HanDanRBao(ccItem).run()
    except:
        pass
    try:
        HanDanWanBao(ccItem).run()
    except:
        pass
    try:
        BaoDingRBao(ccItem).run()
    except:
        pass
    try:
        BaoDingWanBao(ccItem).run()
    except:
        pass
    try:
        ZhangJiaKouRBao(ccItem).run()
    except:
        pass
    try:
        TangShanLaoDongZheRBao(ccItem).run()
    except:
        pass
    try:
        LangFangDuShiBap(ccItem).run()
    except:
        pass
    try:
        NiuChengWanBao(ccItem).run()
    except:
        pass
    try:
        DingZhouRBao(ccItem).run()
    except:
        pass
    try:
        YanZhaoWanBao(ccItem).run()
    except:
        pass
    try:
        YanZhaoWanBao(ccItem).run()
    except:
        pass








def everyDay_dispacther(ccItem):
    '''每天采集调度'''
    try:
        dqrb = DaLianRBao(ccItem)
        dqrb.run()
    except:
        pass
    try:
        dqwb = DaLianWanBao(ccItem)
        dqwb.run()
    except:
        pass
    try:
        sywb = ShenYangWanBao(ccItem)
        sywb.run()
    except:
        pass
    try:
        syrb = ShenYangRBao(ccItem)
        syrb.run()
    except:
        pass
    try:
        tlrb = TongLingRBao(ccItem)
        tlrb.run()
    except:
        pass
    try:
        lnrb = LiaoNingRBao(ccItem)
        lnrb.run()
    except:
        pass
    try:
        lswb = LiaoShenWanBao(ccItem)
        lswb.run()
    except:
        pass
    try:
        bdcb = BanDaoChenBao(ccItem)
        bdcb.run()
    except:
        pass
    try:
        ykrb = YingKouRBao(ccItem)
        ykrb.run()
    except:
        pass
    try:
        tlrb = TieLingRBao(ccItem)
        tlrb.run()
    except:
        pass
    try:
        cyrb = ChaoYangRBao(ccItem)
        cyrb.run()
    except:
        pass
    try:
        fxrb = FuXinRBao(ccItem)
        fxrb.run()
    except:
        pass
    try:
        bgrb = BenGangRBao(ccItem)
        bgrb.run()
    except:
        pass
    try:
        ydcb = YanDuRBao(ccItem)
        ydcb.run()
    except:
        pass
    try:
        hfbr = HeFeiRBao(ccItem)
        hfbr.run()
    except:
        pass
    try:
        hfwb = HeFeiWBao(ccItem)
        hfwb.run()
    except:
        pass
    try:
        jhcb = JiangHuiChenBao(ccItem)
        jhcb.run()
    except:
        pass
    try:
        hhzb = HuaiHeZaoBao(ccItem)
        hhzb.run()
    except:
        pass
    try:
        hnrb = HuaiNanRBao(ccItem)
        hnrb.run()
    except:
        pass
    try:
        wxrb = WanXiRBao(ccItem)
        wxrb.run()
    except:
        pass
    try:
        tlrb = TongLingRBao(ccItem)
        tlrb.run()
    except:
        pass
    try:
        tlysjs = TongLingYouSeJinShu(ccItem)
        tlysjs.run()
    except:
        pass
    try:
        whrb = WuHuRBao(ccItem)
        whrb.run()
    except:
        pass
    try:
        fxb = FoXiaoBao(ccItem)
        fxb.run()
    except:
        pass
    try:
        xcrb = XuanChengRBao(ccItem)
        xcrb.run()
    except:
        pass
    try:
        ahfzb = AnHuiFaZhiBao(ccItem)
        ahfzb.run()
    except:
        pass
    try:
        ahgrrb = AnHuiGongRenRBao(ccItem)
        ahgrrb.run()
    except:
        pass
    try:
        djwb = DaJiangWanBao(ccItem)
        djwb.run()
    except:
        pass
    try:
        yzwb = YingZhouWanBao(ccItem)
        yzwb.run()
    except:
        pass
    try:
        ahqnb = AnHuiQingNianBao(ccItem)
        ahqnb.run()
    except:
        pass
    try:
        ahsb = AnHuiShangBao(ccItem)
        ahsb.run()
    except:
        pass
    try:
        ahncb = AnHuiRBaoNongCunBao(ccItem)
        ahncb.run()
    except:
        pass
    try:
        ahrb = AnHuiRBao(ccItem)
        ahrb.run()
    except:
        pass
    try:
        gsdb = GongShangDaoBao(ccItem)
        gsdb.run()
    except:
        pass
    try:
        jhrb = JiangHuaiShiBao(ccItem)
        jhrb.run()
    except:
        pass
    try:
        scxb = ShiChangXingBao(ccItem)
        scxb.run()
    except:
        pass
    try:
        fyrb = FuYangRBao(ccItem)
        fyrb.run()
    except:
        pass
    try:
        xawb = XinAnWanBao(ccItem)
        xawb.run()
    except:
        pass
    try:
        aqrb = AnQingRBao(ccItem)
        aqrb.run()
    except:
        pass
    try:
        aqwb = AnQingWanBao(ccItem)
        aqwb.run()
    except:
        pass
    try:
        hsrb = HuangShanRBao(ccItem)
        hsrb.run()
    except:
        pass
    try:
        bzwb = BoZhouWanBao(ccItem)
        bzwb.run()
    except:
        pass
    try:
        czrb = ChiZhouRBao(ccItem)
        czrb.run()
    except:
        pass
    try:
        cuzrb = ChuZhouRBao(ccItem)
        cuzrb.run()
    except:
        pass
    try:
        gzrb = GuangZhouRBao(ccItem)
        gzrb.run()
    except:
        pass
    try:
        ycrb = YiCunRBao(ccItem)
        ycrb.run()
    except:
        pass
    try:
        sysrb = ShuangYaShanRBao(ccItem)
        sysrb.run()
    except:
        pass
    try:
        jxrb = JiXiRBao(ccItem)
        jxrb.run()
    except:
        pass
    try:
        ZhongShanRBao(ccItem).run()
    except:
        pass
    try:
        DongNanRBao(ccItem).run()
    except:
        pass
    try:
        GongRenShiBao(ccItem).run()
    except:
        pass
    try:
        XinJiangRBao(ccItem).run()
    except:
        pass
    try:
        XinJiangFaZhiBao(ccItem).run()
    except:
        pass
    try:
        TianJinGongRenBao(ccItem).run()
    except:
        pass
    try:
        TianJinRBao(ccItem).run()
    except:
        pass
    try:
        MeiRXinBao(ccItem).run()
    except:
        pass











def everyDayfu1_dispacther(ccItem):
    '''每天采集前一天调度'''
    try:
        hhrb = HeiHeRBao(ccItem) #无法查看历史
        hhrb.run()
    except:
        pass
    try:
        shrb = SuiHuaRBao(ccItem)
        shrb.run()
    except:
        pass
    try:
        ahgrrb = AnHuiGongRenRBao(ccItem)
        ahgrrb.run()
    except:
        pass
    try:
        NeiMengGuFaZhiBao(ccItem).run()
    except:
        pass
    try:
        CangZhouRBao(ccItem).run()
    except:
        pass
    try:
        CangZhouWanBao(ccItem).run()
    except:
        pass
    try:
        LangFangRBao(ccItem).run()
    except:
        pass


def dispacther():
    #手动部分
    # start_date = datetime.date(2023, 11, 30)
    # end_date = datetime.date(2023, 12, 15)
    # one_day = datetime.timedelta(days=1)
    # current_date = start_date
    # while current_date <= end_date:
    #     ccItem = current_date.strftime('%Y%m%d')
    #     print('-'*12 + ccItem + '-'*12)
    #     # ZhongShanRBao(ccItem).run()
    #     cc_dispacther(ccItem)
    #     everyDay_dispacther(ccItem)
    #     everyDayfu1_dispacther((current_date-datetime.timedelta(days=1)).strftime('%Y%m%d'))
    #     current_date += one_day


    # if time.strftime('%Y%m%d',time.localtime(time.time())) in ccdate:
    #自动部分
    cc_dispacther(time.strftime('%Y%m%d',time.localtime(time.time())))
    everyDay_dispacther(time.strftime('%Y%m%d',time.localtime(time.time())))
    everyDayfu1_dispacther((datetime.date.today()-datetime.timedelta(days=1)).strftime('%Y%m%d'))



if __name__ == '__main__':
    dispacther()